package com.lb.booksecurity.booksecurity.web;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * describe:
 *
 * @author lb
 * @date 2018/09/19
 */
@Component
public class MvcConfig extends WebMvcConfigurerAdapter {
    /**
     * @Author lb
     * @Description 将视图注入mvc
     * @Date 15:53 2018/9/19
     * @Param
     * @return
     **/
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/home").setViewName("home");
        registry.addViewController("/").setViewName("home");
        registry.addViewController("/hello").setViewName("hello");
        registry.addViewController("/aaa").setViewName("login");
    }

}
